/*
 * DxfATTRIB.java
 *
 * Created on 6 de Dezembro de 2007, 10:50
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package importadorDXF;

/**
 *
 * @author rafaelbuck
 */
public class DxfATTRIB extends DxfTEXT
{

    public boolean setGroup(short grpNr, int ival)
    {
        switch(grpNr)
        {
        case 70: // 'F'
            attribFlags = (short)ival;
            return true;

        case 73: // 'I'
            return true;

        case 74: // 'J'
            super.vAdjust = (short)ival;
            return true;
        }
        return super.setGroup(grpNr, ival);
    }

    public boolean setGroup(short grpNr, String str)
    {
        switch(grpNr)
        {
        case 2: // '\002'
            attribName = str;
            return true;
        }
        return super.setGroup(grpNr, str);
    }

    public String getAttributeName()
    {
        return attribName;
    }

    public boolean getVisibility()
    {
        return (attribFlags & 1) == 0;
    }

    public short getAttributeFlags()
    {
        return attribFlags;
    }

    public void convert(DxfConverter converter, DxfFile dxf, Object collector)
    {
        converter.convert(this, dxf, collector);
    }

    /** Creates a new instance of DxfATTRIB */
    public DxfATTRIB()
    {
    }

    public static final short ATT_INVISIBLE = 1;
    public static final short ATT_FIXED = 2;
    public static final short ATT_CHECK = 4;
    public static final short ATT_PREDEFINED = 8;
    protected short attribFlags;
    protected String attribName;
}